// function compose(f, g) {
//   return function (n) {
//     f(g(n))
//   }
// }

// function first(arr) {
//   return arr[0]
// }

// function reverse(arr) {
//   return arr.reverse()
// }


// const fnLast = compose(first, reverse)
// const arr = [1, 2, 3]
// console.log(fnLast([1, 2, 3]))

const _ = require('lodash')

const toUpper = item => item.toUpperCase()
const reverse = arr => arr.reverse()
const first = arr => arr[0]

const f = _.flowRight(toUpper, first, reverse)
console.log(f(['one', 'two', 'three']))